package cn.edu.zut.internship.entity;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class AuthSysUser implements Serializable {
    private Long urId;

    private String urUserName;
    private String urPassword;
    //加密盐
    private Integer urSalt;
    //介绍
    private String introduction;
    //
    private String avatar;
    //姓名
    private String fullName;
    //角色列表
    private List<AuthSysRole> roleList;
    //角色Id列表
    private List<Long> roles;

    private static final long serialVersionUID = 1L;

    public List<AuthSysRole> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<AuthSysRole> roleList) {
        this.roleList = roleList;
    }

    public List<Long> getRoles() {
        if(this.roleList != null){
            this.roles = new ArrayList<>();
            for(AuthSysRole role:roleList){
                this.roles.add(role.getRlId());
            }
        }
        return roles;
    }

    public void setRoles(List<Long> roles) {
        this.roles = roles;
    }

    public Long getUrId() {
        return urId;
    }

    public void setUrId(Long urId) {
        this.urId = urId;
    }

    public String getUrUserName() {
        return urUserName;
    }

    public void setUrUserName(String urUserName) {
        this.urUserName = urUserName == null ? null : urUserName.trim();
    }

    public String getUrPassword() {
        return urPassword;
    }

    public void setUrPassword(String urPassword) {
        this.urPassword = urPassword == null ? null : urPassword.trim();
    }

    public Integer getUrSalt() {
        return urSalt;
    }

    public void setUrSalt(Integer urSalt) {
        this.urSalt = urSalt;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction == null ? null : introduction.trim();
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar == null ? null : avatar.trim();
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName == null ? null : fullName.trim();
    }
}